<template>
  <div class="main">
    <header>
      <div class="header-main">
          <div>
              <p>今日实时数据</p>
              <p>{{tradeHeaderList.table1[0].updatetime}}更新</p>
          </div>
          <div>
            <p>总票房</p>
            <p>{{tradeHeaderList.table0[0].BoxOffice}}<span>环比</span></p>
          </div>
          <div>
            <p>总人次</p>
            <p><span>环比</span></p>
          </div>
          <div>
            <p>总场次</p>
            <p><span>环比</span></p>
          </div>
          <div>
            <p>上座率</p>
            <p><span>环比</span></p>
          </div>
      </div>
    </header>
    <div class="content">
      <div class="content-header">
        <span @click="getPpData(1)" :class="{ active: active }">按场次</span>
        <span @click="getPpData(2)" :class="{ active: !active }">按坐位</span>
      </div>
      <div class="content-main">
        <div v-for="(item, index) in group" :key="item">
          <div class="cm-top">
            <span class="left-icon"></span>
            <span
              >排片{{ groupCat[index] }}({{
                active ? "场次" : "座位"
              }})-TOP10影片</span
            >
          </div>
          <div class="echart-item">
            <div class="echart-height" :ref="item" v-loading="vLoading"></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { GetTradeHeader } from "@/api/trade";
export default {
  data() {
    return {
      tradeHeaderList: [],
    };
  },
  created() {
    GetTradeHeader({ r: 0.05509098143702751 }).then((res) => {
      this.tradeHeaderList = res.data.data;
      console.log(res.data);
    });
  },
};
</script>

<style scoped>
/* 日期 */

.header-main{
  display: flex;
  justify-content: space-evenly;
}
.echart-height {
  margin-top: 20px;
  padding-top: 13px;
  height: 348px;
  border: 1px solid #ececec;
  display: flex;
  justify-content: center;
}

.el-input__inner {
  height: 30px;
}
.el-input__icon.el-icon-date {
  line-height: 25px;
}
.active {
  color: #fff;
  background-color: #7030a0;
}
.main {
  box-sizing: border-box;
  /* height: 100%; */
  background-color: #e4e4e4;
  padding: 20px;
}
.main header,
.content {
  display: flow-root;
  width: 100%;
  background-color: #fff;
}

.main header {
  box-sizing: border-box;
  margin-bottom: 15px;
  padding: 15px;
}
.content-header {
  display: flow-root;
  padding-left: 20px;
  margin: 20px 0;
}
header,
.content {
  box-shadow: 0px 0px 10px -3px rgb(102, 101, 101);
}
.content-header > span {
  float: left;
  padding: 4px 24px;
  border: 1px solid #e0e4eb;
  cursor: pointer;
  font-size: 14px;
}
.content-header > span:last-of-type {
  border-left: none;
}
.content-main {
  width: 100%;
  background-color: #fff;
  height: 100%;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-direction: row;
  /* writing-mode: vertical-lr; */
  flex-wrap: wrap;
}
.content-main > div {
  /* writing-mode: horizontal-tb; */
  width: 48%;
  background-color: rgb(255, 255, 255);
  height: 406px;
  margin-bottom: 10px;
}
.cm-top {
  font-size: 15px;
  vertical-align: middle;
}
.cm-top span {
  vertical-align: middle;
}
.left-icon {
  display: inline-block;
  height: 16px;
  width: 3px;
  background-color: #7030a0;
  margin-right: 10px;
}
</style>